﻿package hyj.redis.hh.redis2;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/*import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.JedisSentinelPool;
import redis.clients.jedis.ShardedJedisPool;
import redis.clients.jedis.JedisShardInfo;*/

/**
 * Hello world!
 *
 */
public class App {
	public static void main(String[] args) {
		dd
		int i =1 ;
		System.out.println(i++);

		// JedisPoolConfig config =new JedisPoolConfig();//Jedis池配置
		// config.setMaxIdle(500);//最大活动的对象个数
		// config.setMaxIdle(1000 * 60);//对象最大空闲时间
		// config.setMaxWaitMillis(1000 * 10);//获取对象时最大等待时间
		// config.setTestOnBorrow(true);
		// List<JedisShardInfo> shards =new ArrayList<JedisShardInfo>(2);
		// shards.add(new JedisShardInfo("127.0.0.1", 6379));
		// shards.add(new JedisShardInfo("192.168.88.105", 6380));
		// ShardedJedisPool sjp = new ShardedJedisPool(config, shards);
		// sjp.getResource().set("name1", "huangyijia");
		// System.out.println(sjp.getResource().get("name1"));

		// JedisPoolConfig config =new JedisPoolConfig();//Jedis池配置
		//
		// config.setMaxIdle(500);//最大活动的对象个数
		// config.setMaxWaitMillis(1000 * 10);//获取对象时最大等待时间
		// config.setTestOnBorrow(true);
		//
		// Set<HostAndPort> nodeList = new HashSet<HostAndPort>();
		// nodeList.add(new HostAndPort("192.168.88.105", 6381));
		// nodeList.add(new HostAndPort("192.168.88.105", 6382));
		// nodeList.add(new HostAndPort("192.168.88.105", 6383));
		// nodeList.add(new HostAndPort("192.168.88.105", 6384));
		// nodeList.add(new HostAndPort("192.168.88.105", 6385));
		// nodeList.add(new HostAndPort("192.168.88.105", 6386));
		//
		// JedisCluster j = new JedisCluster(nodeList, 3000, 3000, 5, "abc",
		// config);
		//
		// j.set("huangyijia", "rediscluster");
		// System.out.println(j.get("huangyijia"));
		//
		// Set<String> sentinels = new HashSet<String>();
		// sentinels.add("192.168.88.105:26379");
		// JedisSentinelPool j = new JedisSentinelPool("mymaster", sentinels,
		// config);
		// JedisSentinelPool j = new JedisSentinelPool("mymaster", sentinels,
		// config, "abc");
		// j.getResource().set("haha", "hhhhhhhhhhh");
		// System.out.println(j.getResource().asking());
		// System.out.println(j.getResource().get("haha"));
	}
}
